import {createRouter, createWebHistory} from "vue-router";
import Home from "@/pages/Home/Home.vue";
import Hospital from "@/pages/Hospital/Hospital.vue";
import Close from "@/pages/Hospital/Close.vue";
import Details from "@/pages/Hospital/Details.vue";
import Register from "@/pages/Hospital/Register.vue";
import Reservation from "@/pages/Hospital/Reservation.vue";
import SearchAndCancel from "@/pages/Hospital/SearchAndCancel.vue";
import WxLogin from "@/pages/WxLogin/WxLogin.vue";
import Reservation_setup1 from "@/pages/Hospital/Reservation_setup1.vue";
import Reservation_setup2 from "@/pages/Hospital/Reservation_setup2.vue";
import User from "@/pages/User/User.vue";
import Certification from "@/pages/User/Certification.vue";
import Feedback from "@/pages/User/Feedback.vue";
import Order from "@/pages/User/Order.vue";
import Patient from "@/pages/User/Patient.vue";
import Profile from "@/pages/User/Profile.vue";
import OrderDetail from "@/pages/User/OrderDetail.vue";

export default createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:'/',
            redirect:'/home'
        },
        {
            path:'/home',
            component:Home
        },
        {
            path:'/hospital',
            component:Hospital,
            children:[
                {
                    path:'close',
                    component:Close
                },
                {
                    path:'details',
                    component:Details
                },
                {
                    path:'register',
                    component:Register
                },
                {
                    path:'reservation',
                    component:Reservation
                },
                {
                    path:'searchAndCancel',
                    component:SearchAndCancel
                },
                {
                    path:'reservation_setup1',
                    component:Reservation_setup1
                },
                {
                    path:'reservation_setup2',
                    component:Reservation_setup2
                },
            ]
        },
        {
            path:'/wxlogin',
            component:WxLogin
        },
        {
            path:'/user',
            component:User,
            children:[
                {
                    path:'certification',
                    component:Certification
                },
                {
                    path:'feedback',
                    component:Feedback
                },
                {
                    path:'order',
                    component:Order
                },
                {
                    path:'patient',
                    component:Patient
                },
                {
                    path:'profile',
                    component:Profile
                },
                {
                    path:'orderDetail',
                    component:OrderDetail
                },
            ]
        },

    ]
})